#include "StdAfx.h"
#include "ModelObjEventHandler_Circuit.h"
#include "ICircuit.h"
#include "ICircuitDisObj.h"
#include "CircuitPic.h"
#include "CircuitPicDisObj.h"

#include "CircuitObjView.h"
#include "HCircuitModel.h"



CModelObjEventHandler_Circuit::CModelObjEventHandler_Circuit(void)
{
	m_pView=NULL;
}


CModelObjEventHandler_Circuit::~CModelObjEventHandler_Circuit(void)
{
}

bool CModelObjEventHandler_Circuit::ObjSelected(const std::list<CObj *> & ObjList,bool bFindObjOnTree)
{
	
	return true;
}

bool CModelObjEventHandler_Circuit::AddToSelected(const CObj *pObj)
{

	return true;
}

bool CModelObjEventHandler_Circuit::RemoveFromSelected(const CObj *pObj)
{

	return true;
}

bool CModelObjEventHandler_Circuit::UnSelectedAll()
{

	return true;
}

bool CModelObjEventHandler_Circuit::DisplayLayer(long lLayerId)
{
	return true;
}

bool CModelObjEventHandler_Circuit::NameChanged(const CObj *pObj)
{
	return true;
}

bool CModelObjEventHandler_Circuit::CompPicFileChanged(const std::list<CObj *> & ObjList)
{	
	return true;

}

bool CModelObjEventHandler_Circuit::LayerThresholdChanged(const CObj *pObj)
{
	return true;
}

bool CModelObjEventHandler_Circuit::UpdateDisplay(const std::list<CObj *> & ObjList)
{
	return true;
}

bool CModelObjEventHandler_Circuit::UpdateDisplay2(const std::list<CObj *> & ObjList)
{
	return true;
}

bool CModelObjEventHandler_Circuit::RefreshProp()
{
	return true;
}

bool CModelObjEventHandler_Circuit::GetHwnd(HWND & hWnd)
{

	return true;
}

bool CModelObjEventHandler_Circuit::GetActiveLayerId(long & lLayerId)
{

	return true;
}

bool CModelObjEventHandler_Circuit::GetModelKey(HC_KEY & key)
{
	HCircuitModel* pHmodel = m_pView->GetHoopsModel();

	key=pHmodel->GetModelKey();

	return true;
}

bool CModelObjEventHandler_Circuit::Manhattanize(std::list<std::pair<double, double> > & pt_lst, int startDirection, bool keepOriginalPoints)
{

	return true;
}

bool CModelObjEventHandler_Circuit::HideOrShowRefWires(const list<CObj *> & ObjList)
{
	return true;
}

bool CModelObjEventHandler_Circuit::HideOrShowChildDevice(const std::list<CObj *> & ObjList)
{
	return true;
}

// bool CModelObjEventHandler::HideOrShowSubSystem(CSystemDisplayObj* pSysDisObj)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return  pMain->HideOrShowSubSystem(pSysDisObj);
// }

// bool CModelObjEventHandler::HideOrShowDevice(CDeviceDisplayObj* pDevDisObj)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->HideOrShowDevice(pDevDisObj);
// }

// bool CModelObjEventHandler::HideOrShowCable(CCable* pCable)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->HideOrShowCable(pCable);
// }

// bool CModelObjEventHandler::HideOrShowWire(CWireDisplayObj* pWireDisObj)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->HideOrShowWire(pWireDisObj);
// }

// bool CModelObjEventHandler::HideOrShowConnector(CConnectorDisplayObj* pConDisObj)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->HideOrShowConnector(pConDisObj);
// }

// bool CModelObjEventHandler::HideOrShowSepCon(CSeparateConnectorDisplayObj* pSepConDisObj)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->HideOrShowSepCon(pSepConDisObj);
// }

// bool CModelObjEventHandler::HideOrShowSubCable(CSubCable* pSubCable)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->HideOrShowSubCable(pSubCable);
// }

// bool CModelObjEventHandler::HideOrShowPin(CPinDisplayObj* pPinDisObj)
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->HideOrShowPin(pPinDisObj);
// }

void CModelObjEventHandler_Circuit::SetTreeItemImage(std::list<CObj*>& lstObj)
{

}

void CModelObjEventHandler_Circuit::UpdateCableItem()
{

}

bool CModelObjEventHandler_Circuit::IsInActiveLayer(std::list<CSubCable*>& lstSubCable)
{
	return true;
}

// CLayer* CModelObjEventHandler::GetActiveLayer()
// {
// 	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
// 
// 	return pMain->GetActiveLayer();
// }

void CModelObjEventHandler_Circuit::DisplayLayerAttribute()
{

}

bool CModelObjEventHandler_Circuit::IsInActiveLayer(CCable* pCable)
{
	return true;
}

bool CModelObjEventHandler_Circuit::IsInOneCable(std::list<CSubCable*>& lstSubCable)
{
	return true;
}

int CModelObjEventHandler_Circuit::SubCableVisibleFlag()
{
	return true;
}

int CModelObjEventHandler_Circuit::CableVisibleFlag()
{
	return true;
}

void CModelObjEventHandler_Circuit::UpdateSystemItem(std::list<CObj*>& lstObj)
{
;
}

bool CModelObjEventHandler_Circuit::HideOrShow(std::list<CObj*>& lstObj)
{
	return true;
}

bool CModelObjEventHandler_Circuit::Display(std::list<CDisplayObj *>& lstObj)
{

	return true;
}

bool CModelObjEventHandler_Circuit::ChangeColorAndTextAttribute(const std::list<CObj *> & ObjList)
{
	return true;
}

bool CModelObjEventHandler_Circuit::GetDesignTreeCtrl(CTreeCtrl * & pTree)
{
	return true;
}

bool CModelObjEventHandler_Circuit::GetCheckTreeCtrl(CTreeCtrl * & pTree)
{

	return true;
}

HTREEITEM CModelObjEventHandler_Circuit::GetTreeItem(CTreeCtrl& treeCtrl, DWORD dwData, HTREEITEM hStartAtItem/* =NULL */)
{
	return NULL;
}

bool CModelObjEventHandler_Circuit::ChangeWireStyle(const std::list<CObj *> & ObjList)
{
	return true;
}

bool CModelObjEventHandler_Circuit::GetActiveDocPath(CString & strPath)
{

	return true;
}

bool CModelObjEventHandler_Circuit::SetDocModified(bool bModified)
{

	return true;
}

bool CModelObjEventHandler_Circuit::ExistDoc()
{
	return true;
}

CSystem * CModelObjEventHandler_Circuit::GetActiveSystem() const
{
	return NULL;
}

bool CModelObjEventHandler_Circuit::RefreshDisplay()
{

	return true;
}

bool CModelObjEventHandler_Circuit::SetupTree()
{

	return true;
}

bool CModelObjEventHandler_Circuit::SetupCheckTree()
{

	return true;
}

bool CModelObjEventHandler_Circuit::SetupFullDataCheckTree()
{
	return true;
}

bool CModelObjEventHandler_Circuit::GetSceneKey(long &sceneKey)
{

	return true;
}

bool CModelObjEventHandler_Circuit::GetThreshold(double &fThreshold)
{
	return true;
}

bool CModelObjEventHandler_Circuit::FilterWires(CLayer *pLayer, long lSnTyeId, bool bShow)
{

	return true;
}

bool CModelObjEventHandler_Circuit::Highlight(CObj *pObj)
{
	return true;
}
//0717;
bool CModelObjEventHandler_Circuit::HighlightWireSeg(CObj *pWireDisplayObj, std::list<CObj *>*pTextDisplayObjList, double start_pt[], double end_pt[])
{

	return true;
}

bool CModelObjEventHandler_Circuit::ClearHighlightWireSeg()
{
	return true;
}

//bool CModelObjEventHandler::ShowWireSegText(CObj *pObj, int nSegIndex, bool bShow)
//{
//	if(!pObj)
//		return false;
//	if(!pObj->IsDisplayObj())
//		return false;
//	
//	CDisplayObj *pDisplayObj=(CDisplayObj *)pObj;
//	if(!pDisplayObj->IsWireDisplayObj())
//		return false;
//	CWireDisplayObj *pWireDisplayObj=(CWireDisplayObj *)pDisplayObj;
//
//	pWireDisplayObj->ShowWireSegText(nSegIndex, bShow);
//
//	return true;
//}

bool CModelObjEventHandler_Circuit::ShowWiresSegText(std::list<CWireDisplayObj *>pWireObjList, int nSegIndex, bool bShow)
{

	return true;
}

bool CModelObjEventHandler_Circuit::updateSubsysBackground(CSubSystem *pSys)
{
	return true;
}

CEntityObj *CModelObjEventHandler_Circuit::ConstructICircuit(CEntityObj *pDevice)
{
	return new CICircuit((CDevice *)pDevice);
}

CDisplayObj *CModelObjEventHandler_Circuit::ConstructICircuitDisObj(CEntityObj *pICircuit)
{
	return new CICircuitDisObj(pICircuit);
}

CEntityObj *CModelObjEventHandler_Circuit::ConstructCircuitPic(CEntityObj *pDevice)
{
	return new CCircuitPic((CDevice *)pDevice);
}

CDisplayObj *CModelObjEventHandler_Circuit::ConstructCircuitPicDisObj(CEntityObj *pCirPic)
{
	return new CCircuitPicDisObj(pCirPic);
}

bool CModelObjEventHandler_Circuit::GetUndoXMLPath(std::string & xmlPath)
{

	return true;
}

bool CModelObjEventHandler_Circuit::GetHoopsView(DWORD &dwView)
{
	
	return true;
}

DWORD CModelObjEventHandler_Circuit::GetHoopsView() const
{
	return NULL;
}

void CModelObjEventHandler_Circuit::SetHoopsView(DWORD val)
{

}

DWORD CModelObjEventHandler_Circuit::GetHoopsDWordModel() const
{
	return NULL;
}

bool CModelObjEventHandler_Circuit::GetMaxCommandID(int &nId)
{

	return true;
}

bool CModelObjEventHandler_Circuit::GetActiveLayer(CLayer* &pLayer)
{

	return true;
}

void CModelObjEventHandler_Circuit::GetActiveWndId(int &nWndId)
{
	
}

bool CModelObjEventHandler_Circuit::GetHoopsViewByWndId(int nWndId, DWORD &dwView)
{

	return true;
}

bool CModelObjEventHandler_Circuit::ActiveFrameWnd(int nWndId)
{
	return true;
}

bool CModelObjEventHandler_Circuit::GetViewClientRect(CRect & rcClient)
{
	return true;
}

bool CModelObjEventHandler_Circuit::DeleteConnectorAll(CConnector* pConnector)
{

	return true;
}

CIdsFullData* CModelObjEventHandler_Circuit::GetIdsFullData()
{

	return NULL;
}

HModelLayerModel* CModelObjEventHandler_Circuit::GetHoopsModel() const
{
	return NULL;
}

void CModelObjEventHandler_Circuit::RefreshWarnWireList( std::list<CWire*> pWarnWireList )
{

}

void CModelObjEventHandler_Circuit::PostWireMessageToGroundDlg( CWireDisplayObj *pWireDisObj )
{

}

void CModelObjEventHandler_Circuit::transSubline_AGnd(CGroundPatternDisObj *pGndDisObj)
{

}

bool CModelObjEventHandler_Circuit::JudgeIsRightWire(CWireDisplayObj* pWireDisObj)
{
	return true;
}

void CModelObjEventHandler_Circuit::SetWireListOfGndDevice( std::list<CWire *> wireList )
{

}

void CModelObjEventHandler_Circuit::CircuitIDIncrease(CSystem* pSystem,long lCurMaxId,std::map<long,CEntityObj*> &mapOldId2Obj,std::map<long,CLayer*> &mapOldId2Layer)
{

}

bool CModelObjEventHandler_Circuit::HideDisplayObj(CDisplayObj *pDispalyObj)
{
	return true;
}

std::list<CWire *> CModelObjEventHandler_Circuit::GetWireListOfGndDevice()
{
	return m_lstWireOfGndDevice;
}

void CModelObjEventHandler_Circuit::HighlightObjListFromTree( const std::list<CObj *> & ObjList )
{

}

void CModelObjEventHandler_Circuit::DeleteAllSelectionFromTree()
{

}
